<?php
class block_oaeditor extends block_list{
	
	public function init() {
		$this->title = get_string('oaeditor', 'block_oaeditor');
	}
	
	public function get_content() {
		
		global $CFG, $COURSE, $PAGE, $SESSION, $USER;
		
		// server data
		$data = new stdClass();
		$data->course_id = $COURSE->id;
		$data->context = $PAGE->context;
		$data->coursecontact = $CFG->coursecontact;
		$SESSION->srv_data_encoded = urlencode(base64_encode(serialize($data)));
		
		if ($this->content !== null) {
			return $this->content;
		}
	
		$this->content         = new stdClass;
		$this->content->items  = array();
		$this->content->footer = '<p style="font-size:10px; font-weight:bold;">&copy; Todos os direitos reservados.</p>';
	
		$this->content->items[] = html_writer::tag('a', '<img src="../blocks/oaeditor/app/webroot/img/logo.png" />', array('href' => '../blocks/oaeditor/'));
		
		return $this->content;
	}
	
	public function hide_header() {
		return true;
	}
	
	public function applicable_formats() {
	  	return array(
	        'course-view' => true, 
	    	'course-view-social' => false
	    );
	}
	
}
?>
